using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace backend.Models.Dtos
{
    public class RepairRequestCreateDto
    {
        [JsonPropertyName("userID")]
        public string UserID { get; set; } = null!;
        [JsonPropertyName("description")]
        public string Description { get; set; } = null!;
        [JsonPropertyName("image")]
        public IFormFile? Image { get; set; }
        [JsonPropertyName("area")]
        public string Area { get; set; } = null!;
        [JsonPropertyName("location")]
        public string Location { get; set; } = null!;
        [JsonPropertyName("detailedLocation")]
        public string DetailedLocation { get; set; } = null!;
        [JsonPropertyName("expectedTime")]
        public DateTime ExpectedTime { get; set; }
        [JsonPropertyName("faultTypeID")]
        public string FaultTypeID { get; set; } = null!;
    }

    public class RepairRequestDto
    {
        public string UserID { get; set; } = null!;
        public string UserName { get; set; } = null!;
        public string UserPhone { get; set; } = null!;
        public string? StaffID { get; set; }
        public string? StaffName { get; set; }
        public string? StaffPhone { get; set; }
        public string Description { get; set; } = null!;
        public string? Image { get; set; }
        public string DetailedLocation { get; set; } = null!;
        public string FaultType { get; set; } = null!;
        public string? Evaluate { get; set; }
        public DateTime? ExpectedTime { get; set; }
        public string Status { get; set; } = null!;
        public DateTime StartTime { get; set; }
        public DateTime? FixStartTime { get; set; }
        public DateTime? EndTime { get; set; }
        public decimal? ResponseTime { get; set; }
        public decimal? ServiceQuality { get; set; }
        public decimal? ServiceAttitude { get; set; }
    }

    public class RepairRequestListDto
    {
        [JsonPropertyName("orderID")]
        public int OrderID { get; set; }

        [JsonPropertyName("area")]
        public string Area { get; set; } = null!;

        [JsonPropertyName("location")]
        public string Location { get; set; } = null!;

        [JsonPropertyName("faultType")]
        public string FaultType { get; set; } = null!;

        [JsonPropertyName("status")]
        public string Status { get; set; } = null!;

        [JsonPropertyName("startTime")]
        public DateTime StartTime { get; set; }

        [JsonPropertyName("areaIsDeleted")]
        public bool AreaIsDeleted { get; set; }
    }

    public class RepairRequestUpdateDto
    {
        public string? Status { get; set; }
        public RatingDto? Rating { get; set; }
        public string? Evaluate { get; set; }

        public class RatingDto
        {
            public decimal ResponseTime { get; set; }
            public decimal ServiceQuality { get; set; }
            public decimal ServiceAttitude { get; set; }
        }
    }
}